package com.skywolf.chem.common.sysconfig.pojo.entity;

/**
 * Created by pei_pei on 2020/10/27.
 */

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;

public class BaseEntity {
    @ApiModelProperty("主键")
    private Long id;
    @ApiModelProperty("创建人")
    @TableField(
            fill = FieldFill.INSERT
    )
    private Long createdBy;
    @ApiModelProperty("更新人")
    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    private Long updatedBy;
    @ApiModelProperty("创建时间")
    @TableField(
            fill = FieldFill.INSERT
    )
    private LocalDateTime createdTime;
    @ApiModelProperty("更新时间")
    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    private LocalDateTime updatedTime;
    @TableLogic
    @TableField("is_deleted")
    @ApiModelProperty("逻辑删除  0未删除 1已删除")
    private Boolean deleted = Boolean.valueOf(false);

    public String toString() {
        return "BaseEntity(id=" + this.getId() + ", createdBy=" + this.getCreatedBy() + ", updatedBy=" + this.getUpdatedBy() + ", createdTime=" + this.getCreatedTime() + ", updatedTime=" + this.getUpdatedTime() + ", deleted=" + this.getDeleted() + ")";
    }

    public BaseEntity() {
    }

    public Long getId() {
        return this.id;
    }

    public Long getCreatedBy() {
        return this.createdBy;
    }

    public Long getUpdatedBy() {
        return this.updatedBy;
    }

    public LocalDateTime getCreatedTime() {
        return this.createdTime;
    }

    public LocalDateTime getUpdatedTime() {
        return this.updatedTime;
    }

    public Boolean getDeleted() {
        return this.deleted;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setCreatedBy(Long createdBy) {
        this.createdBy = createdBy;
    }

    public void setUpdatedBy(Long updatedBy) {
        this.updatedBy = updatedBy;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public boolean equals(Object o) {
        if(o == this) {
            return true;
        } else if(!(o instanceof BaseEntity)) {
            return false;
        } else {
            BaseEntity other = (BaseEntity)o;
            if(!other.canEqual(this)) {
                return false;
            } else {
                Long this$id = this.getId();
                Long other$id = other.getId();
                if(this$id == null) {
                    if(other$id != null) {
                        return false;
                    }
                } else if(!this$id.equals(other$id)) {
                    return false;
                }

                Long this$createdBy = this.getCreatedBy();
                Long other$createdBy = other.getCreatedBy();
                if(this$createdBy == null) {
                    if(other$createdBy != null) {
                        return false;
                    }
                } else if(!this$createdBy.equals(other$createdBy)) {
                    return false;
                }

                Long this$updatedBy = this.getUpdatedBy();
                Long other$updatedBy = other.getUpdatedBy();
                if(this$updatedBy == null) {
                    if(other$updatedBy != null) {
                        return false;
                    }
                } else if(!this$updatedBy.equals(other$updatedBy)) {
                    return false;
                }

                label62: {
                    LocalDateTime this$createdTime = this.getCreatedTime();
                    LocalDateTime other$createdTime = other.getCreatedTime();
                    if(this$createdTime == null) {
                        if(other$createdTime == null) {
                            break label62;
                        }
                    } else if(this$createdTime.equals(other$createdTime)) {
                        break label62;
                    }

                    return false;
                }

                label55: {
                    LocalDateTime this$updatedTime = this.getUpdatedTime();
                    LocalDateTime other$updatedTime = other.getUpdatedTime();
                    if(this$updatedTime == null) {
                        if(other$updatedTime == null) {
                            break label55;
                        }
                    } else if(this$updatedTime.equals(other$updatedTime)) {
                        break label55;
                    }

                    return false;
                }

                Boolean this$deleted = this.getDeleted();
                Boolean other$deleted = other.getDeleted();
                if(this$deleted == null) {
                    if(other$deleted != null) {
                        return false;
                    }
                } else if(!this$deleted.equals(other$deleted)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof BaseEntity;
    }

    public int hashCode() {
        boolean PRIME = true;
        byte result = 1;
        Long $id = this.getId();
        int result1 = result * 59 + ($id == null?43:$id.hashCode());
        Long $createdBy = this.getCreatedBy();
        result1 = result1 * 59 + ($createdBy == null?43:$createdBy.hashCode());
        Long $updatedBy = this.getUpdatedBy();
        result1 = result1 * 59 + ($updatedBy == null?43:$updatedBy.hashCode());
        LocalDateTime $createdTime = this.getCreatedTime();
        result1 = result1 * 59 + ($createdTime == null?43:$createdTime.hashCode());
        LocalDateTime $updatedTime = this.getUpdatedTime();
        result1 = result1 * 59 + ($updatedTime == null?43:$updatedTime.hashCode());
        Boolean $deleted = this.getDeleted();
        result1 = result1 * 59 + ($deleted == null?43:$deleted.hashCode());
        return result1;
    }
}

